﻿using OtpNet;
using System;
using System.Collections.Generic;
using System.Text;

namespace Yhd.Captcha.Core.Helpers
{
    public static class Base32Helper
    {
        public static byte[] GetBase32Bytes(int length)
        {
            var key = KeyGeneration.GenerateRandomKey(length);

            var base32String = Base32Encoding.ToString(key);
            var base32Bytes = Base32Encoding.ToBytes(base32String);
            return base32Bytes;
        }
    }
}
